/*
 * @(#)SaveXmlAction.java
 *
 *
 * ver 1.0 Oct 3, 2007 ggranum
 */
package org.testfire.agent.action;

import java.util.*;

// eof: SaveXmlAction.java

/**
 * Save an XML Testset to the local store.
 */
public abstract class Action
{
    private final boolean requiresAllParameters;

    private final List<String> expectedParams;

    private final List<String> expectedParamValues;

    protected Action()
    {
        this( false, new ArrayList<String>(), new ArrayList<String>() );
    }

    protected Action( boolean requiresAllParameters )
    {
        this( requiresAllParameters, new ArrayList<String>(), new ArrayList<String>() );
    }

    public Action( List<String> expectedParams, List<String> expectedParamValues )
    {
        this( false, expectedParams, expectedParamValues );
    }

    public Action( boolean requiresAllParameters, List<String> expectedParams, List<String> expectedParamValues )
    {
        this.expectedParamValues = expectedParamValues;
        this.expectedParams = expectedParams;
        this.requiresAllParameters = requiresAllParameters;
    }

    public Action( boolean requiresAllParameters, String[] expectedParams, String[] expectedParamValues )
    {
        this.requiresAllParameters = requiresAllParameters;
        this.expectedParams = Arrays.asList( expectedParams ) ; 
        this.expectedParamValues = Arrays.asList( expectedParamValues ) ;
    }

    public abstract String perform( Map<String, String> parameters, Map<String, String[]> paramValues );

    public final List<String> getExpectedParams()
    {
        return this.expectedParams;
    }

    public final List<String> getExpectedParamValues()
    {
        return this.expectedParamValues;
    }

    public boolean getRequiresAllParameters() {return requiresAllParameters;}


}